Repository navigation
fix(flow-chat): restore history paging and resynchronization recovery - #3935
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Restore older-history paging after catalog changes and make “重新同步记录” recover from a failed read. The retry button accepts pointer input, reserves its presentation commit before the host snapshot changes the rendered boundary, and resumes paging with the refreshed catalog.
Fixes #3928
Type and Areas
Type: Bug fix
Areas: Web UI / FlowChat history paging, reader restoration, tests and documentation
Motivation / Impact
A catalog refresh can retire the store's active range while the reader still displays it. Reacquire that range before extending it, including when an adjacent read adopts a new catalog.
Explicit synchronization could also invalidate its own pager ticket when the returned snapshot moved the rendered boundary, leaving the loading indicator active after cancellation. Reserve the commit before synchronization and settle only the loading state owned by that request, surface, session and presentation. Late cancelled reads cannot clear a newer retry.
For explicit recovery, accept a changed host catalog revision even when its previews are incomplete. An obsolete complete catalog must not override fresh host positions. Preserve complete previews for the same revision and retain the ordinary Peer snapshot merge policy.
Verification
pnpm --dir src/web-ui exec vitest run src/flow_chat/store/FlowChatStore.test.ts src/flow_chat/components/modern/flowChatHistoryPager.test.ts src/flow_chat/components/modern/VirtualMessageList.history-paging.test.ts src/flow_chat/components/modern/ModernFlowChatContainer.history-restore.test.tsx src/flow_chat/components/modern/VirtualMessageList.resize.test.tsx— 432 tests passed across five files.pnpm run check:web— passed.OPENBITFUN_WEB_FONT_PROFILE=apple-system pnpm run build:web— passed, including production asset and WebKit compatibility checks.git diff --check— passed.Reviewer Notes
The supplied-geometry resize fixture shares measurements only within a read-only snapshot and uses direct attribute reads to avoid repeated jsdom dataset enumeration. It retains fresh measurements across gestures, DOM changes and observer callbacks, with the same assertions, scroll coverage and test timeout. The 18-case fixture took about 2.5 seconds locally after this change, versus about 5 seconds before.
Native evidence covers local macOS with deliberately injected filesystem failures; it does not establish spontaneous failure in ordinary sessions. SSH workspace and Peer Device paths have controlled component/store fixture coverage only. Live remote workspace, remote control, Peer Device and Detached Dispatch scenarios were not exercised. Detached history synchronization continues to reject controller-storage fallback.
The change is in the shared frontend; it adds no persisted schema or remote protocol fields.
Checklist